package net.xdclass.strategy;

import java.util.ArrayList;
import java.util.List;

public class ShardingTableConfig {

    private static final List<String> tableSuffix = new ArrayList<>();

    static {
        tableSuffix.add("0");
        tableSuffix.add("a");
    }

    /**
     * 获取表随机后缀
     * @return
     * @param code
     */
    public static String getRandomTableSuffi(String code){
        int hashCode = code.hashCode();
        int index = Math.abs(hashCode) % tableSuffix.size();
        return tableSuffix.get(index);
    }


}
